//
//  ButtonCollectionCell.m
//  mall
//
//  Created by lianjie on 2018/3/6.
//  Copyright © 2018年 vito. All rights reserved.
//

#import "ButtonCollectionCell.h"

@implementation ButtonCollectionCell


- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        // 1.初始化imageView、label。
        CGFloat cellWidth = self.bounds.size.width * 0.5;
//        CGFloat cellHeight = self.bounds.size.height;
        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake((self.bounds.size.width / 2) - (cellWidth / 2), 5, cellWidth, cellWidth)];
        _label = [[UILabel alloc] initWithFrame:CGRectMake(0, _imageView.frame.size.height + _imageView.frame.origin.y + 15, self.contentView.bounds.size.width, 20)];
        _label.textAlignment = NSTextAlignmentCenter;
        _label.textColor = UIColorFromRGB(0xbbbbbb);
        
        _label.font = [UIFont systemFontOfSize:13.0f];
        
        // 2.添加imageView、label到cell。
        [self.contentView addSubview:_imageView];
        [self.contentView addSubview:_label];
    }
    return self;
}



@end
